<!DOCTYPE html>
<html lang="en" class="bg-dark">
<head>
    <meta charset="utf-8"/>
    <title>{$title}</title>
    <meta name="description"
          content="app, web app, responsive, admin dashboard, admin, flat, flat ui, ui kit, off screen nav"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <link rel="stylesheet" href="__PUBLIC__/css/app.v2.css" type="text/css"/>
    <style>
        #bg {
            width: 100%;
            height: 100%;
            top: 0px;
            left: 0px;
            position: absolute;
        }
    </style>
    <script src="__PUBLIC__/js/app.v2.js"></script>
    <script src="__PUBLIC__/validate/dist/jquery.validate.min.js"></script>
    <script src="__PUBLIC__/validate/dist/localization/messages_zh.js"></script>
    <script type="text/javascript" src="__PUBLIC__/js/layer1.93/layer.js"></script>
    <script type="text/javascript" src="__PUBLIC__/site.js"></script>
</head>
<body style="padding-top:100px;margin: 0px;">
<!--<img id="bg" src="__WAP__/images/admin_bg.jpg"/>-->
<section id="content" class="m-t-lg wrapper-md animated fadeInUp" style="margin-top:0!important;height:100%;">
    <div class="container aside-xxl">
        <img style="display:block; margin: 10px auto;width:300px;height:130px;" src="{:config('ADMIN_LOGIN_LOGO')}">
        <section class="panel panel-default bg-white m-t-lg">
            <header class="panel-heading"><strong>用户登陆</strong></header>
            <form id="ajaxform" action="{:url('login')}" class="panel-body wrapper-lg login-form" autocomplete="off"
                  method="post">
                <div class="form-group">
                    <label class="control-label">用户名</label>
                    <input type="text" id="username" name="username" placeholder="输入用户名" class="form-control input-lg"
                           autocomplete="off">
                </div>
                <div class="form-group">
                    <label class="control-label">密码</label>
                    <input type="password" id="password" name="password" placeholder="输入密码"
                           class="form-control input-lg"
                           autocomplete="off">
                </div>
                <div class="form-group">
                    <label class="control-label">验证码</label>
                    <div class="form-inline">
                        <div class="form-group" style="display: flex;align-items: center;justify-content: space-between;">
                            <input type="text" name="verify" placeholder="输入验证码" class="form-control input-lg"
                                   autocomplete="off" style="width:50%">
                            <img id="verify" style="height: 45px;width: 48%" onclick="verifyChang(this)"
                                 src="{:url('makeCaptcha')}" alt="验证码"/>
                        </div>
                    </div>
                </div>

                <!--<div class="form-group">-->
                <!--<label class="control-label">短信验证码</label>-->
                <!--<div class="form-inline">-->
                <!--<div class="form-group">-->
                <!--<input type="hidden" id="mobile" value="17175324063">-->
                <!--<input type="number" placeholder="请输入短信验证码" name="code" class="form-control input-lg" style="width:62%">-->
                <!--<button class="huoqu code" onclick="javascript:return false;" style="height:43px;">发送验证码</button>-->
                <!--</div>-->

                <!--</div>-->
                <!--</div>-->
            </form>
            <button type="button" class="btn btn-primary" onclick="tijiao();return false;"
                    style="width: 86%;margin-left: 7%;margin-bottom: 30px;height: 40px;margin-top: -20px;">登 陆
            </button>
        </section>
    </div>
</section>
<script src="__PUBLIC__/js/jquery-3.2.1.min.js"></script>
<script src="__PUBLIC__/phone.js"></script>
<script>
    function verifyChang(obj) {
        $(obj).attr("src", "{:url('makeCaptcha')}");
    }

    function tijiao() {
        var action = $('#ajaxform').attr('action');
        if (action) {
            $url = action;
        } else {
            layer.msg('请输入跳转地址');
            return false;
        }
        $.post($url, $('#ajaxform').serialize(), function (data) {
            if (data.code) {
                layer.msg(data.msg);
                setTimeout(function () {
                    layer.closeAll();
                    var index = layer.load('正在跳转...');
                    window.location.href = data.url
                }, 2000);
            } else {
                layer.msg(data.msg);
                $('#verify').attr("src", "{:url('makeCaptcha')}");
            }
        })
    }
</script>
</body>
</html>